import request from '@/utils/request'

export function listAdmin(data) {
  return request({
    url: `/account/page?current=${data.current}&size=${data.size}`,
    method: 'post',
    data
  })
}

export function createAdmin(data) {
  return request({
    url: '/account/',
    method: 'post',
    data
  })
}
//获取账号绑定的角色
export function relation(accountId) {
  return request({
    url:`permission/account-role/relation/${accountId}`,
    method: 'get',
  })
}
//获取账号绑定的角色
export function bindRole(data) {
  return request({
    url:`permission/account-role/bind`,
    method: 'post',
    data
  })
}

export function updateAdmin(data) {
  return request({
    url: '/account/',
    method: 'put',
    data
  })
}

export function deleteAdmin(data) {
  return request({
    url: `account/${data.accountId}`,
    method: 'put',
  })
}
